<%@ page language="java"  import="com.sc.bean.GoodsBean"  import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%-- <%!public index_jsp() { --%>
<%-- 	super(); --%>
<%-- 	System.out.println("abc"); --%>
<%-- 	} %> --%>
	<%--<%myA();
	 System.out.println(basePath);--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
String id = request.getParameter("id");

		//从柜子中取出购物车
		
		List<GoodsBean> sc = (List<GoodsBean>) session.getAttribute("sc");
		if (sc == null) {
			sc = new ArrayList<GoodsBean>();
		}

		Iterator<GoodsBean> it = sc.iterator();
		while(it.hasNext()){
			GoodsBean g = it.next();
			if(g.getId().toString().equals(id)){
				it.remove();
				break;
			}
		}
		
		//购物车放回柜子
		session.setAttribute("sc", sc);

		// resp
		response.sendRedirect("SCartPage.jsp");
		 %>
<html>

  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
 
</html>
